<template>
    <el-form ref="optionBtnRef" :model="courseForm" :rules="courseFormVerify" label-width="100px" size="medium" >
        <el-row>
            <el-col :span="20">
                <el-form-item label="课程名词" prop="courseName">
                    <el-input v-model="courseForm.courseName" placeholder="请输入课程名词"/>
                </el-form-item>
            </el-col>
            <el-col :span="4">
                <el-button style="margin-left: 20px;" size="small" type="primary" @click="add" icon="el-icon-plus">添加课程</el-button>
            </el-col>
        </el-row>
    </el-form>
</template>

<script>
    import {addCourseApi} from '@/api/words/wordApi'
    export default {
        props:{
            courseForm:{
                type: Object,
                required: true
            },
            courseFormVerify:{
                type: Object,
                required: true
            }
        },
        data(){
            return {
                course:"course"
            }
        },
        methods:{
            //重置表单
            reset(){
                this.$refs.optionBtnRef.resetFields();
            },
            //校验表单
            validate(){
                let checkResult = true;
                this.$refs.optionBtnRef.validate((valid) => {
                    checkResult = valid;
                })
                return checkResult;
            },
            //新增课程
            add(){
                this.$emit("addCourse");
            },
        },
    }
</script>

<style scoped lang="scss">
</style>